﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;

namespace Tracking.Common.Utils
{
    public class HashUtils
    {
        public static string GetHash(string password)
        {
            var md5 = MD5.Create();
            MemoryStream ms = new MemoryStream();
            var passBytes = Encoding.ASCII.GetBytes(password);
            ms.Write(passBytes, 0, passBytes.Length);

            var hashBytes = md5.ComputeHash(passBytes);
            var hash = Encoding.ASCII.GetString(hashBytes);
            return hash;
        }

    }
}